import requests

from DataTest.yaml_data.yaml_data import load_yaml

phone_data = load_yaml('../DataTest/yaml_data/NewEnrollPhone.yaml')
for data in phone_data:
    phone, token = data.get('phone'), data.get('token')
    # id, token = NewUserEnroll(phone)
    header = {
        'Authorization': f"Bearer {token}",
        'Content-Type': 'application/json'
    }
    print(header)


# def UpdateUserInfo():


def GetInfo():
    url = 'http://124.220.33.63:8700/match/info'

    res = requests.get(url=url, headers=header)
    print(res.json())
    return res.json().get('code')


def NewMatch():
    code = GetInfo()
    url = 'http://124.220.33.63:8700/match/info'
    data = {
        "code": code
    }


if __name__ == '__main__':
    GetInfo()
